<template>
    <a-modal v-model:visible="visible" title="Add User" @ok="handleOk">
      <a-form :model="form">
        <a-form-item label="Name" name="name">
          <a-input v-model:value="form.name" />
        </a-form-item>
        <a-form-item label="Email" name="email">
          <a-input v-model:value="form.email" />
        </a-form-item>
      </a-form>
    </a-modal>
  </template>
  
  <script lang="ts" setup>
  import { ref } from 'vue';
  
  const props = defineProps({
    visible: Boolean,
  });
  
  const emit = defineEmits(['update:visible', 'submit']);
  
  const form = ref({
    name: '',
    email: '',
  });
  
  const handleOk = () => {
    emit('submit', form.value);
  };
  </script>